package main

import (
	"fmt"
	"strings"
)

func main() {
	var a string
	var err error
	fmt.Println("Plz input your string:")
	_, err = fmt.Scanf("%s", &a)
	if err != nil {
		panic(err)
	}
	a = strings.TrimSpace(a)
	var mod int
	ran := 9999
	for _, v := range a {
		mod = mod + int(v)%ran
	}
	mod = mod % ran
	fmt.Println(mod)
}
